<h2>Grant Submissions</h2>   

<div id="filter">
<% form_remote_tag(:html => {:id => "submission_list_filter"},
  :url => {:action => 'filter'},
	:update => "submission_table", 
	:loading => 'Element.hide("submission_table")',
	:complete => visual_effect(:appear, "submission_table", :duration => 0.5) ) do %>
<strong>Cycle:</strong> 
	<%= select("filter", "cycle", Cycle.find(:all, :order => 'id desc').collect {|c| [ c.name, c.id ] }, 
	           {:include_blank => true},
	           {:onchange => '$F("submission_list_watcher_cycle_id")=5;cnn.com
		alert($F("submission_list_watcher_cycle_id"))'}) %> &nbsp;&nbsp;
<strong>Status:</strong> 
	<%= select("filter", "status", Status.find(:all).collect {|s| [ s.name, s.id ] }, {:include_blank => true}) %> &nbsp;&nbsp;
<!-- <%= submit_tag 'Update Filter' %> -->
 
	<div id="money_spent"></div>
<% end %>      

</div>

<br />
<div id="submission_table">
</div>  

<%= observe_form 'submission_list_filter', 
			:url => {:action => 'filter'}, 
			:update => 'submission_table', 
			:loading => ['Element.hide("submission_table")'],
			:complete => [visual_effect(:appear, "submission_table", :duration => 0.5),
										"new Ajax.Updater('money_spent', '/submission/money_spent/' + $F('filter_cycle'), {asynchronous:true, evalScripts:true})"],
			:frequency => 1 %>
